package com.org.gsc.chartdemo.activitys;
import android.graphics.Color;

import com.github.mikephil.charting.charts.RadarChart;
import com.github.mikephil.charting.data.RadarData;
import com.github.mikephil.charting.data.RadarDataSet;
import com.github.mikephil.charting.data.RadarEntry;
import com.github.mikephil.charting.interfaces.datasets.IRadarDataSet;
import com.org.gsc.chartdemo.R;
import com.org.gsc.chartdemo.bases.BaseActivity;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by qundui on 2017/10/9.
 * 蜘蛛网图
 */
public class RadarAct extends BaseActivity {
    private RadarChart mRadarChart;
    private List<IRadarDataSet> mdatas;
    private RadarDataSet m雷达图;

    @Override
    protected void doBusy() {
        mRadarChart=findView(R.id.rc);
        mdatas=new ArrayList<>();
        List<RadarEntry> ys=new ArrayList<>();
        for(int i=0;i<30;i++){
            ys.add(new RadarEntry((float) i/10));
        }
        //mRadarChart.setDescription("我是描述");
        // 绘制线条宽度，圆形向外辐射的线条
        mRadarChart.setWebLineWidth(1.5f);
        // 内部线条宽度，外面的环状线条
        mRadarChart.setWebLineWidthInner(1.0f);
        // 所有线条WebLine透明度
//        mRadarChart.setWebAlpha(100);

        m雷达图 = new RadarDataSet(ys, "雷达图");
        m雷达图.setColor(Color.YELLOW);
//        m雷达图.setFillColor(Color.rgb(103, 110, 129));
//        m雷达图.setDrawFilled(true);
//        m雷达图.setFillAlpha(180);
        m雷达图.setLineWidth(2f);
        m雷达图.setDrawHighlightCircleEnabled(true);
        m雷达图.setDrawHighlightIndicators(false);
//        m雷达图.setDrawFilled(true);
        mdatas.add(m雷达图);
        mRadarChart.setBackgroundColor(Color.GREEN);
        mRadarChart.setData(new RadarData(mdatas));

    }
    @Override
    protected int getLayoutId() {
        return R.layout.radaract;
    }
}
